﻿@using KPIS.GERP.Models.ViewModel
@using KPIS.GERP.Models.ICM
@using KPIS.GERP.Models
@model IEnumerable<MasPurchaseType>

@{
    ViewBag.Title = "ประเภทการจัดหา";
}

@using (Html.BeginForm("Index", "MasPurchaseType", FormMethod.Post, new { id = "form" }))
{
    
    @Html.AntiForgeryToken()
        @Html.AntiForgeryToken()
    <div class="row-fluid">
        <div class="block-button-menu-above">
        </div>
        @Html.ValidationSummary(true, "", new { @class = "alert alert-error" })
        <div class="row-fluid">
            <div class="table-header span12">
				<div class="span10">@ViewBag.Title</div>
				@Html.Partial("_ExportButton")
            </div>
        </div>  
        <table id="table" class="table table-striped table-bordered table-hover" aria-describedby="table_info">
            <thead>
                <tr>
                    <th style="width:250px">
                      รายการประเภทการจัดหา
                    </th>
					<th style="width:auto">
						รายละเอียด
					</th>
                    <th class="center" style="width:80px;">&nbsp;
                    </th>
                </tr>
            </thead>

            <tbody>
                @foreach (var m in Model)
                {
                    <tr>
                       <td>
                           @Html.DisplayFor(model => m.PcTypeName)
                       </td>
                        <td>
                           @Html.DisplayFor(model => m.PcTypeDescr)
                       </td>
                        <td class="td-actions">
							    @Html.Partial("_ButtonMenuEachRow", new KPIS.GERP.Models.ViewModel.ExportGrid
                                {
                                    Id = m.PcTypeId,
                                    DetailsUrl = Url.Action("Details") + "/" + m.PcTypeId,
                                    EditUrl = Url.Action("Edit") + "/" + m.PcTypeId,
                                })
                               
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
}

@section scripts {
    
	<script type="text/javascript">
		$(function () {
			var oTable1 = $('#table').dataTable({
				"aoColumns": [
                    null,
                    { "bSortable": false },
                     { "bSortable": false }
				]
			});

			$('[data-rel=tooltip]').tooltip();

		})

	</script>

}
